package com.yh.doing.interpret_pattern;

/**
 * @program: design-patterns
 * @description: ${description}
 * @author: yangh0597@163.com
 * @date: 2021-03-09 17:15
 * @problem:
 **/
public class VarExpression extends Expression{

    private String var;

    public VarExpression(String var) {
        this.var = var;
    }

    @Override
    public int interprete(Context context) {
        return context.get(this.var);
    }
}
